package com.nsu.evaluation.controller;

import com.nsu.evaluation.common.ServerResponse;
import com.nsu.evaluation.pojo.Class;
import com.nsu.evaluation.service.impl.ClassServiceImpl;
import lombok.extern.slf4j.Slf4j;
import net.sf.jsqlparser.schema.Server;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.awt.geom.RectangularShape;
import java.io.Serializable;

@Controller
@RequestMapping(value = "/api/class/")
public class ClassController {

    @Autowired
    private ClassServiceImpl classServiceImpl;

    @RequestMapping("getClassNameById")
    @ResponseBody
    public ServerResponse getClassNameById(String class_id){
        ServerResponse response = classServiceImpl.getClassNameById(class_id);
        if(response.isSuccess()){
            return ServerResponse.createBySuccess("获取班级名称成功",response.getData());
        }
        return ServerResponse.createByErrorMessage("获取班级名称失败");
    }
}
